﻿using Microsoft.EntityFrameworkCore;
using SimpleWebApi.Business.Service.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace SimpleWebApi.Business.Service
{
    public class BaseService : IBaseService
    {
        protected DbContext Context;
        public BaseService(DbContext context)
        {
            Console.WriteLine($"{this.GetType().Name}被构造了......");
            this.Context = context;
        }
        public IQueryable<T> Query<T>(Expression<Func<T, bool>> funcWhere) where T : class
        {
            return this.Context.Set<T>().Where<T>(funcWhere);
        }

    }
}